let mysql = require('mysql');

var pool = mysql.createPool({
    host: 'localhost',
    user: 'root',
    password: '123',
    port: 3306,
    database: 'book',
    multipleStatements: true
});


module.exports = {
    query: (sql, callback) => {
        pool.query(sql, (err, result) => {

            if (err) {
                callback(false, '')
            } else {
                callback(true, result)
            }
        })
    }
}